package chapter15;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : DuJiabao
 * @Date : 2021/2/23 16:57
 * @Project : thinking_in_java
 * @File : null.java
 * @Desc :
 */
public class extendsTest {
  public static void main(String[] args) throws Exception {
    Class<? extends List> cls = ArrayList.class;
    List list = cls.getDeclaredConstructor().newInstance();  // 将会让父类List接收
    System.out.println(list);

    Class<? super Man> clazz = Man.class.getSuperclass();
    Object object = clazz.getDeclaredConstructor().newInstance();  // 没办法接收，会让Object接收
  }
}

class Person {
  public Person() {
  }
}

class Man extends Person {
  public Man() {
  }
}